package day15;
/**
 *  查找输入整数二进制中1的个数
 *  https://www.nowcoder.com/practice/1b46eb4cf3fa49b9965ac3c2c1caf5ad?tpId=37&&tqId=21285&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */

import java.util.Scanner;
public class Main {
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int result = 0;
        while (n != 0) {
            if((n&1) == 1) {
                result++;
            }
            n = n >> 1;
        }
        System.out.println(result);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String str = Integer.toBinaryString(n);   //转化成字符串形式的二进制
        char[] chars = str.toCharArray();
        int count = 0;
        for (int i = 0; i < chars.length; i++) {
            if(chars[i] == '1') {
                count++;
            }
        }
        System.out.println(count);
    }

}
